1. Field of the Invention
The present invention relates to an access apparatus and method for accessing a storage medium and a computer program product which includes a computer usable medium having a computer readable program embodied therein for accessing the storage medium.
2. Description of the Related Art
Hard disk devices, MOs (Magneto-Optical disks) and flash memories are generally employed as storage mediums (in which data can be written and from which data can be read) accessible by computers, etc. These storage mediums are utilized to store data and to transfer data between computers.
The aforementioned storage mediums need to be accessed under their respective conditions destined for them. Accordingly, an access apparatus needs to be capable of accessing the to-be-accessed storage mediums under the conditions which match with them.
In order to permit the access apparatus to access the storage mediums, those storage mediums store or generate data representing their respective access conditions. The access apparatus acquires the data from the storage mediums and accesses them in accordance with the conditions specified by the acquired data if the access apparatus can fulfill those conditions.
Conventionally, however, such an access apparatus could not access a plurality of kinds of storage mediums without changing its operational setting, unless a storage medium of one kind has the upper compatibility with storage mediums of other kinds.
For the sake of access to the plurality of kinds of storage mediums, therefore, different access apparatuses had to be employed one for each kind. Alternatively, an access apparatus capable of gaining access, under the conditions which conform to a storage medium of one kind having the upper compatibility with storage mediums of other kinds, has to be employed for the sake of access to the plurality of kinds of storage mediums.
In the case of employing different access apparatuses one for each kind of storage medium, the structure of the entire system including the access apparatuses is complicated. On the other hand, in the case of employing an access apparatus capable of gaining access under the conditions which conform to a storage medium of one kind having the upper compatibility with storage mediums of other kinds, the structure of the entire apparatus is also complicated.
The present invention has been made in consideration of the above-described circumstances, and an object thereof is to provide an access apparatus, a data processing system and an access method, all being capable of gaining, with a simple structure, access to a plurality of kinds of storage mediums whose access conditions are different from each other.
According to the first aspect of the present invention having the above-described object, there is provided an access apparatus comprising:
a controller which acquires condition-defined data from a storage medium that stores data containing the condition-defined data specifying conditions for access to the storage medium, and which performs an acquisition of data from the storage medium and an erasure and storage of data other than the condition-defined data from and into the storage medium in accordance with the conditions specified by the condition-defined data as acquired; and
storage which stores replacement data representing contents of a replacement for a to-be-replaced portion of the condition-defined data;
wherein the controller accesses the storage medium in accordance with the conditions specified by the condition-defined data, acquired from the storage medium and whose to-be-replaced portion has been replaced with the replacement data.
According to the above access apparatus, the conditions for access to the storage medium are changed in accordance with the contents of the replacement data. This permits a plurality of kinds of storage mediums, whose access conditions are different from each other, to be accessed employing a simple structure.
According to the second aspect of the present invention, there is provided a data processing system comprising a storage medium which stores data containing condition-defined data that specifies conditions for access to the storage medium, and an access apparatus which acquires the condition-defined data from the storage medium and performs an acquisition of data from the storage medium and an erasure and storage of data other than the condition-defined data from and into the storage medium in accordance with the conditions specified by the condition-defined data as acquired, the accessing apparatus comprising:
storage which stores replacement data representing contents of a replacement for a to-be-replaced portion of the condition-defined data; and
a controller which accesses the storage medium in accordance with the conditions specified by the condition-defined data, acquired from the storage medium and whose to-be-replaced portion has been replaced with the replacement data.
According to the above-described data processing system, the conditions for access by the controller are changed in accordance with the contents of the replacement data. This allows a plurality of kinds of storage mediums, whose access conditions are different from each other, to be accessed employing a simple structure.
The storage medium may include identification data stored therein for identifying the storage medium; and
the controller may acquire the identification data from the storage medium, determine whether to access the storage medium in accordance with the identification data as acquired, and access the storage medium when the controller determines to access the storage medium.
By so doing, a determination is made in advance as to whether the storage medium is proper as a target to be accessed, thus preventing damage to data stored in the storage medium and improper access to the storage medium.
In this case, the storage may store identification data; and
the controller may determine whether there is a substantial match between the identification data acquired from the storage medium and the identification data stored in the storage, and may determine to access the storage medium when the controller determines that there is a substantial match between the acquired identification data and the identification data stored in the storage.
The varieties of accessible storage mediums are increased and access to a storage medium of a novel kind is facilitated by thus storing the identification data in the storage.
In the case where the controller replaces the replacement data stored in the storage with new replacement data in accordance with an externally supplied instruction, the conditions for access can be changed with ease.
The storage medium may have a plurality of storage areas including storage areas which store the data and storage areas which do not store the data; and
the controller may create and store an empty area table specifying the storage areas which do not store the data, among the plurality of storage areas, and may cause the storage areas specified by the empty area table to store the data.
The above-described structure allows a storage area, into which data ought to be written, to be quickly discovered from among the plurality of storage areas, with the result that access is speeded up.
The storage medium may have a plurality of storage areas assigned physical addresses and including storage areas which store data to be acquired and storage areas which store data to be erased, and the storage medium may store an address translation table which shows the physical addresses and logical addresses associated therewith; and
the controller may perform
designating logical addresses specifying the storage areas which store the data to be acquired and the storage areas which store the data to be erased, and
specifying the physical addresses associated with the designated logical addresses, based on the address translation table and the designated logical addresses, and accessing the storage areas assigned the specified physical addresses.
By so doing, even if the physical address of a storage area storing specific data is changed, a particular logical address can be assigned to the storage area storing the data. This facilitates the locating of data stored in the storage medium.
In this case, the plurality of storage areas may have been divided into groups;
the address translation table may show the physical addresses assigned to the storage areas belonging to one of the groups and the logical addresses associated with the physical addresses; and
the controller may perform
determining whether it is possible to specify, based on the address translation table, the physical addresses associated with the logical addresses designated by the controller, and specifying among the groups a group of storage areas assigned the physical addresses associated with the designated logical addresses, when the controller determines that it is impossible to specify the physical address,
updating the address translation table so as to show the physical addresses assigned to the specified group of storage areas and the logical addresses associated with the physical addresses, and
specifying the physical addresses associated with the logical addresses designated by the controller, based on the updated address translation table and the designated logical addresses, and accessing the storage areas assigned the specified physical addresses.
Employing the above structure, the correspondence between the logical and physical addresses is established as for some storage areas, not for all storage areas. Therefore, even if the entire storage area is large, the amount of information contained in the address translation table is reduced, and the storage capacity required for the storage of the address translation table is reduced accordingly.
According to the third aspect of the present invention, there is provided an access method for acquiring condition-defined data from a storage medium that stores data containing the condition-defined data specifying conditions for access to the storage medium, and for accessing the storage medium in accordance with the conditions specified by the condition-defined data as acquired, the access method comprising the steps of:
storing replacement data which represents contents of a replacement for a to-be-replaced portion of the condition-defined data; and
performing an acquisition of data from the storage medium and an erasure and storage of data other than the condition-defined data from and into the storage medium in accordance with the conditions specified by the condition-defined data, acquired from the storage medium and whose to-be-replaced portion has been replaced with the replacement data.
According to the above access method, the conditions for access to the storage medium are changed in accordance with the contents of the replacement data. This enables access to a plurality of kinds of storage mediums, which differ in access condition from each other, to be gained employing a simple structure.
The storage medium may include identification data stored therein for identifying the storage medium; and
the access method may further comprise the steps of
acquiring the identification data from the storage medium, determining whether to access the storage medium in accordance with the acquired identification data, and accessing the storage medium when it is determined to access the storage medium.
By so doing, a determination is made in advance as to whether the storage medium is proper as a target to be accessed, thus preventing damage to data stored in the storage medium and improper access to the storage medium.
In this case, the access method may further comprise the steps of determining whether there is a substantial match between the identification data acquired from the storage medium and pre-stored collation data, and determining to access the storage medium when it is determined that there is a substantial match between the acquired identification data and the pre; stored collation data. The varieties of accessible storage mediums are increased and access to a storage medium of a novel kind is facilitated by thus preparing the collation data in advance for use in the identification of the storage mediums.
The storage medium may have a plurality of storage areas including storage areas which store the data and storage areas which do not store the data; and
the access method may further comprise the steps of
creating and storing an empty area table specifying the storage areas which do not store the data, among the plurality of storage areas, and causing the storage areas specified by the empty area table to store the data.
The above-described structure allows a storage area, into which data is ought to be written, to be quickly discovered from among the plurality of storage areas, with the result that access is speeded up.
The storage medium may have a plurality of storage areas assigned physical addresses and including storage areas which store data to be acquired and storage areas which store data to be erased, and the storage medium may store an address translation table which shows the physical addresses and logical addresses associated therewith; and
the access method may further comprise the steps of
designating logical addresses specifying the storage areas which store the data to be acquired and the storage areas which store the data to be erased, and
specifying the physical addresses associated with the designated logical addresses, based on the address translation table and the designated logical addresses, and accessing the storage areas assigned the specified physical addresses.
By so doing, even if the physical address of a storage area storing specific data is changed, a particular logical address can be assigned to the storage area storing the data. This facilitates the locating of data stored in the storage medium.
In this case, the plurality of storage areas may have been divided into groups;
the address translation table may show the physical addresses assigned to the storage areas belonging to one of the groups and the logical addresses associated with the physical addresses; and
the access method may further comprise the steps of
determining whether it is possible to specify, based on the address translation table, the physical addresses associated with the designated logical addresses, and specifying among the groups a group of storage areas assigned the physical addresses associated with the designated logical addresses, when it is determined that it is impossible to specify the physical address,
updating the address translation table so as to show the physical addresses assigned to the specified group of storage areas and the logical addresses associated with the physical addresses, and
specifying the physical addresses associated with the designated logical addresses, based on the updated address translation table and the designated logical addresses, and accessing the storage areas assigned the specified physical addresses.
Employing the above structure, the correspondence between the logical and physical addresses is established as for some storage areas, not for all storage areas. Therefore, if the entire address area is large, the amount of information contained in the address translation table is reduced, and the storage capacity required for a storage of the address translation table is reduced accordingly.
According to the fourth aspect of the present invention, there is provided a computer program product, including a computer usable medium having a computer readable program embodied therein for causing a computer, which performs an acquisition of data from a storage medium and an erasure and storage of data from and into the storage medium, to serve as:
storage which stores replacement data representing contents of a replacement for a to-be-replaced portion of condition-defined data specifying conditions for access to the storage medium; and
a controller which acquires the condition-defined data from the storage medium that stores data containing the condition-defined data, and which performs an acquisition of data from the storage medium and an erasure and storage of data other than the condition-defined data from and into the storage medium in accordance with the conditions specified by the condition-defined data, acquired from the storage medium and whose to-be-replaced portion has been replaced with the replacement data.
A computer, which executes the program stored in such a storage medium, changes the conditions for access to the storage medium in accordance with the contents of the replacement data. This enables access to a plurality of kinds of storage mediums, which differ in access condition from each other, to be gained employing a simple structure.
According to the fifth aspect of the present invention, there is provided a computer data signal embedded in a carrier wave and representing a program for causing a computer, which performs an acquisition of data from a storage medium and an erasure and storage of data from and into the storage medium, to serve as:
storage which stores replacement data representing contents of a replacement for a to-be-replaced portion of condition-defined data specifying conditions for access to the storage medium; and
a controller which acquires the condition-defined data from the storage medium that stores data containing the condition-defined data, and which performs an acquisition of data from the storage medium and an erasure and storage of data other than the condition-defined data from and into the storage medium in accordance with the conditions specified by the condition-defined data, acquired from the storage medium and whose to-be-replaced portion has been replaced with the replacement data.
A computer, which executes the program represented by such a computer data signal, changes the conditions for access to the storage medium in accordance with the contents of the replacement data. This enables access to a plurality of kinds of storage mediums, whose access conditions are different from each other, to be gained employing a simple structure.